I. Preliminaries

Loading libraries

library("tidyverse")
library("tibble")
library("msigdbr")
library("ggplot2")
library("TCGAbiolinks")
library("RNAseqQC")
library("DESeq2")
library("ensembldb")
library("purrr")
library("magrittr")
library("vsn")
library("matrixStats")
library("dplyr")
library("grex")
library("survminer")
library("survival")

II. Downloading the TCGA gene expression data

Create a function for downloading TCGA gene expression data.

For more detailed documentation, refer to 2. Differential Gene Expression Analysis - TCGA.Rmd.

query_and_filter_samples <- function(project) {
  query_tumor <- GDCquery(
    project = project,
    data.category = "Transcriptome Profiling",
    data.type = "Gene Expression Quantification",
    experimental.strategy = "RNA-Seq",
    workflow.type = "STAR - Counts",
    access = "open",
    sample.type = "Primary Tumor"
  )
  tumor <- getResults(query_tumor)

  query_normal <- GDCquery(
    project = project,
    data.category = "Transcriptome Profiling",
    data.type = "Gene Expression Quantification",
    experimental.strategy = "RNA-Seq",
    workflow.type = "STAR - Counts",
    access = "open",
    sample.type = "Solid Tissue Normal"
  )
  normal <- getResults(query_normal)

  submitter_ids <- inner_join(tumor, normal, by = "cases.submitter_id") %>%
    dplyr::select(cases.submitter_id)
  tumor <- tumor %>%
    dplyr::filter(cases.submitter_id %in% submitter_ids$cases.submitter_id)
  normal <- normal %>%
    dplyr::filter(cases.submitter_id %in% submitter_ids$cases.submitter_id)

  samples <- rbind(tumor, normal)
  unique(samples$sample_type)

  query_project <- GDCquery(
    project = project,
    data.category = "Transcriptome Profiling",
    data.type = "Gene Expression Quantification",
    experimental.strategy = "RNA-Seq",
    workflow.type = "STAR - Counts",
    access = "open",
    sample.type = c("Solid Tissue Normal", "Primary Tumor"),
    barcode = as.list(samples$sample.submitter_id)
  )

  # If this is your first time running this notebook (i.e., you have not yet downloaded the results of the query in the previous block),
  # uncomment the line below

  # GDCdownload(query_project)

  return(list(samples = samples, query_project = query_project))
}

Download the TCGA gene expression data for colorectal cancer (TCGA-COAD).

projects <- c("TCGA-COAD")

with_results_projects <- c()

samples <- list()
project_data <- list()

for (project in projects) {
  result <- tryCatch(
    {
      result <- query_and_filter_samples(project)
      samples[[project]] <- result$samples
      project_data[[project]] <- result$query_project

      with_results_projects <- c(with_results_projects, project)
    },
    error = function(e) {

    }
  )
}

Running the code block above should generate and populate a directory named GDCdata.

III. Data preprocessing

Construct the RNA-seq count matrix for each cancer type.

tcga_data <- list()
tcga_matrix <- list()

projects <- with_results_projects
for (project in projects) {
  tcga_data[[project]] <- GDCprepare(project_data[[project]], summarizedExperiment = TRUE)
}
for (project in projects) {
  count_matrix <- assay(tcga_data[[project]], "unstranded")

  # Remove duplicate entries
  count_matrix_df <- data.frame(count_matrix)
  count_matrix_df <- count_matrix_df[!duplicated(count_matrix_df), ]
  count_matrix <- data.matrix(count_matrix_df)
  rownames(count_matrix) <- cleanid(rownames(count_matrix))
  count_matrix <- count_matrix[!(duplicated(rownames(count_matrix)) | duplicated(rownames(count_matrix), fromLast = TRUE)), ]

  tcga_matrix[[project]] <- count_matrix
}

Format the samples table so that it can be fed as input to DESeq2.

for (project in projects) {
  rownames(samples[[project]]) <- samples[[project]]$cases
  samples[[project]] <- samples[[project]] %>%
    dplyr::select(case = "cases.submitter_id", type = "sample_type")
  samples[[project]]$type <- str_replace(samples[[project]]$type, "Solid Tissue Normal", "normal")
  samples[[project]]$type <- str_replace(samples[[project]]$type, "Primary Tumor", "tumor")
}

DESeq2 requires the row names of samples should be identical to the column names of count_matrix.

for (project in projects) {
  colnames(tcga_matrix[[project]]) <- gsub(x = colnames(tcga_matrix[[project]]), pattern = "\\.", replacement = "-")
  tcga_matrix[[project]] <- tcga_matrix[[project]][, rownames(samples[[project]])]

  # Sanity check
  print(all(colnames(tcga_matrix[[project]]) == rownames(samples[[project]])))
}

IV. Differential gene expression analysis

For more detailed documentation on obtaining the gene set, refer to 7. Differential Gene Expression Analysis - TCGA - Pan-cancer - Unique Genes.Rmd.

RCDdb <- "temp/unique_genes/necroptosis_ferroptosis_pyroptosis/"

Write utility functions for filtering the gene sets, performing differential gene expression analysis, plotting the results, and performing variance-stabilizing transformation.

filter_gene_set_and_perform_dgea <- function(genes) {
  tcga_rcd <- list()

  for (project in projects) {
    rownames(genes) <- genes$gene_id
    tcga_rcd[[project]] <- tcga_matrix[[project]][rownames(tcga_matrix[[project]]) %in% genes$gene_id, ]
    tcga_rcd[[project]] <- tcga_rcd[[project]][, rownames(samples[[project]])]
  }

  dds_rcd <- list()
  res_rcd <- list()

  for (project in projects) {
    print(project)
    print("=============")
    dds <- DESeqDataSetFromMatrix(
      countData = tcga_rcd[[project]],
      colData = samples[[project]],
      design = ~type
    )
    dds <- filter_genes(dds, min_count = 10)
    dds$type <- relevel(dds$type, ref = "normal")
    dds_rcd[[project]] <- DESeq(dds)
    res_rcd[[project]] <- results(dds_rcd[[project]])
  }

  deseq.bbl.data <- list()

  for (project in projects) {
    deseq.results <- res_rcd[[project]]
    deseq.bbl.data[[project]] <- data.frame(
      row.names = rownames(deseq.results),
      baseMean = deseq.results$baseMean,
      log2FoldChange = deseq.results$log2FoldChange,
      lfcSE = deseq.results$lfcSE,
      stat = deseq.results$stat,
      pvalue = deseq.results$pvalue,
      padj = deseq.results$padj,
      cancer_type = project,
      gene_symbol = genes[rownames(deseq.results), "gene"]
    )
  }

  deseq.bbl.data.combined <- bind_rows(deseq.bbl.data)
  deseq.bbl.data.combined <- dplyr::filter(deseq.bbl.data.combined, abs(log2FoldChange) >= 1.5 & padj < 0.05)

  return(deseq.bbl.data.combined)
}
plot_dgea <- function(deseq.bbl.data.combined) {
  sizes <- c("<10^-15" = 4, "10^-10" = 3, "10^-5" = 2, "0.05" = 1)

  deseq.bbl.data.combined <- deseq.bbl.data.combined %>%
    mutate(fdr_category = cut(padj,
      breaks = c(-Inf, 1e-15, 1e-10, 1e-5, 0.05),
      labels = c("<10^-15", "10^-10", "10^-5", "0.05"),
      right = FALSE
    ))

  top_genes <- deseq.bbl.data.combined %>%
    group_by(cancer_type) %>%
    mutate(rank = rank(-abs(log2FoldChange))) %>%
    dplyr::filter(rank <= 10) %>%
    ungroup()

  ggplot(top_genes, aes(y = cancer_type, x = gene_symbol, size = fdr_category, fill = log2FoldChange)) +
    geom_point(alpha = 0.5, shape = 21, color = "black") +
    scale_size_manual(values = sizes) +
    scale_fill_gradient2(low = "blue", mid = "white", high = "red", limits = c(min(deseq.bbl.data.combined$log2FoldChange), max(deseq.bbl.data.combined$log2FoldChange))) +
    theme_minimal() +
    theme(
      axis.text.x = element_text(size = 9, angle = 90, hjust = 1)
    ) +
    theme(legend.position = "bottom") +
    theme(legend.position = "bottom") +
    labs(size = "Adjusted p-value", fill = "log2 FC", y = "Cancer type", x = "Gene")
}
perform_vsd <- function(genes) {
  tcga_rcd <- list()

  for (project in projects) {
    rownames(genes) <- genes$gene_id
    tcga_rcd[[project]] <- tcga_matrix[[project]][rownames(tcga_matrix[[project]]) %in% genes$gene_id, ]
    tcga_rcd[[project]] <- tcga_rcd[[project]][, rownames(samples[[project]])]
  }

  vsd_rcd <- list()

  for (project in projects) {
    print(project)
    print("=============")
    dds <- DESeqDataSetFromMatrix(
      countData = tcga_rcd[[project]],
      colData = samples[[project]],
      design = ~type
    )
    dds <- filter_genes(dds, min_count = 10)

    # Perform variance stabilization
    dds <- estimateSizeFactors(dds)
    nsub <- sum(rowMeans(counts(dds, normalized = TRUE)) > 10)
    vsd <- vst(dds, nsub = nsub)
    vsd_rcd[[project]] <- assay(vsd)
  }

  return(vsd_rcd)
}

Necroptosis

Fetch the gene set of interest.

genes <- read.csv(paste0(RCDdb, "Necroptosis.csv"))
print(genes)
genes$gene_id <- cleanid(genes$gene_id)
genes <- distinct(genes, gene_id, .keep_all = TRUE)
genes <- subset(genes, gene_id != "")
genes

Filter the genes to include only those in the gene set of interest, and then perform differential gene expression analysis.

deseq.bbl.data.combined <- filter_gene_set_and_perform_dgea(genes)
[1] "TCGA-COAD"
[1] "============="
Warning: some variables in design formula are characters, converting to factorsestimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
-- replacing outliers and refitting for 1 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
fitting model and testing
deseq.bbl.data.combined

Plot the results.

plot_dgea(deseq.bbl.data.combined)

Perform variance-stabilizing transformation for further downstream analysis (i.e., for survival analysis).

vsd <- perform_vsd(genes)
[1] "TCGA-COAD"
[1] "============="

V. Downloading the clinical data

Download clinical data from TCGA, and perform some preprocessing: - The deceased column should be FALSE if the patient is alive and TRUE otherwise - The overall_survival column should reflect the follow-up time if the patient is alive and the days to death otherwise

download_clinical_data <- function(project) {
  clinical_data <- GDCquery_clinic(project)
  clinical_data$deceased <- ifelse(clinical_data$vital_status == "Alive", FALSE, TRUE)
  clinical_data$overall_survival <- ifelse(clinical_data$vital_status == "Alive",
    clinical_data$days_to_last_follow_up,
    clinical_data$days_to_death
  )

  return(clinical_data)
}
tcga_clinical <- list()
for (project in projects) {
  tcga_clinical[[project]] <- download_clinical_data(project)
}

VI. Performing survival analysis

Write utility functions for performing survival analysis.

construct_gene_df <- function(gene_of_interest, project) {
  normal_df <- tcga_matrix[[project]] %>%
    as.data.frame() %>%
    rownames_to_column(var = "gene_id") %>%
    gather(key = "case_id", value = "counts", -gene_id) %>%
    left_join(., genes, by = "gene_id") %>%
    dplyr::filter(gene == gene_of_interest) %>%
    dplyr::filter(case_id %in% rownames(samples[[project]] %>% dplyr::filter(type == "normal")))
  normal_df$case_id <- paste0(sapply(strsplit(as.character(normal_df$case_id), "-"), `[`, 1), '-',
                            sapply(strsplit(as.character(normal_df$case_id), "-"), `[`, 2), '-', 
                            sapply(strsplit(as.character(normal_df$case_id), "-"), `[`, 3))
  
  tumor_df <- tcga_matrix[[project]] %>%
      as.data.frame() %>%
      rownames_to_column(var = "gene_id") %>%
      gather(key = "case_id", value = "counts", -gene_id) %>%
      left_join(., genes, by = "gene_id") %>%
      dplyr::filter(gene == gene_of_interest) %>%
      dplyr::filter(case_id %in% rownames(samples[[project]] %>% dplyr::filter(type == "tumor")))
  tumor_df$case_id <- paste0(sapply(strsplit(as.character(tumor_df$case_id), "-"), `[`, 1), '-',
                            sapply(strsplit(as.character(tumor_df$case_id), "-"), `[`, 2), '-', 
                            sapply(strsplit(as.character(tumor_df$case_id), "-"), `[`, 3))
  
  gene_df <- inner_join(normal_df, tumor_df, by = c("gene_id", "case_id", "deathtype", "gene", "description", "gene_biotype", "pmid", "comment"))
  gene_df$log_fold = log2(gene_df$counts.y / gene_df$counts.x)
  
  gene_df$strata <- ifelse(abs(gene_df$log_fold) >= 1.5, "HIGH", "LOW")
  gene_df <- merge(gene_df, tcga_clinical[[project]], by.x = "case_id", by.y = "submitter_id")
  
  return(gene_df)
}
compute_surival_fit <- function(gene_df) {
  return (survfit(Surv(overall_survival, deceased) ~ strata, data = gene_df))
}
compute_cox <- function(gene_df) {
  return (coxph(Surv(overall_survival, deceased) ~ strata, data=gene_df))
}
plot_survival <- function(fit) {
  return(ggsurvplot(fit,
    data = gene_df,
    pval = T,
    risk.table = T,
    risk.table.height = 0.3
  ))
}
compute_survival_diff <- function(gene_df) {
  return(survdiff(Surv(overall_survival, deceased) ~ strata, data = gene_df))
}

Perform survival analysis by testing for the difference in the Kaplan-Meier curves using the G-rho family of Harrington and Fleming tests: https://rdrr.io/cran/survival/man/survdiff.html

MLKL is the primary executor of necroptosis.

significant_projects <- c()
significant_genes <- c()

ctr <- 1
for (project in projects) {
  for (gene in c("MLKL", genes$gene)) {
    cat(project, gene, "\n\n")
    tryCatch (
      {
        gene_df <- construct_gene_df(gene, project)
      },
      error = function(e) {
      }
    )

    if (nrow(gene_df) > 0) {
      fit <- compute_surival_fit(gene_df)
      tryCatch (
        {
          survival <- compute_survival_diff(gene_df)
          cox <- compute_cox(gene_df)
          print(ctr)
          ctr <- ctr + 1
          print(survival)
          cat("\n")
          print(cox)
          print(plot_survival(fit))
          if (pchisq(survival$chisq, length(survival$n)-1, lower.tail = FALSE) < 0.05) {
            significant_projects <- c(significant_projects, project)
            significant_genes <- c(significant_genes, gene)
          }
        },
        error = function(e) {
        }
      )
      
    }
    
    cat("\n\n============================\n\n")
  }
}
TCGA-COAD MLKL 

[1] 1
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  9        2     1.13    0.6795     0.769
strata=LOW  37       10    10.87    0.0703     0.769

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z    p
strataLOW -0.6831    0.5051   0.7938 -0.86 0.39

Likelihood ratio test=0.64  on 1 df, p=0.4224
n= 46, number of events= 12 


============================

TCGA-COAD RBCK1 

[1] 2
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  7        2     1.23     0.482     0.562
strata=LOW  39       10    10.77     0.055     0.562

 Chisq= 0.6  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z    p
strataLOW -0.5963    0.5508   0.8068 -0.739 0.46

Likelihood ratio test=0.49  on 1 df, p=0.4849
n= 46, number of events= 12 


============================

TCGA-COAD JAK2 

[1] 3
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 17        3     4.42     0.454     0.775
strata=LOW  29        9     7.58     0.265     0.775

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.5917    1.8071   0.6819 0.868 0.385

Likelihood ratio test=0.81  on 1 df, p=0.3674
n= 46, number of events= 12 


============================

TCGA-COAD ZBP1 

[1] 4
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 21        5     5.24   0.01133    0.0219
strata=LOW  25        7     6.76   0.00879    0.0219

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW 0.09016   1.09434  0.60925 0.148 0.882

Likelihood ratio test=0.02  on 1 df, p=0.8822
n= 46, number of events= 12 


============================

TCGA-COAD RNF31 

[1] 5
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 16        4     4.32    0.0241      0.04
strata=LOW  30        8     7.68    0.0136      0.04

 Chisq= 0  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)   z     p
strataLOW 0.1257    1.1339   0.6289 0.2 0.842

Likelihood ratio test=0.04  on 1 df, p=0.8408
n= 46, number of events= 12 


============================

TCGA-COAD IFNB1 

[1] 6
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

n=8, 38 observations deleted due to missingness.

            N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 7        2    2.607     0.141      1.19
strata=LOW  1        1    0.393     0.938      1.19

 Chisq= 1.2  on 1 degrees of freedom, p= 0.3 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z     p
strataLOW 1.445     4.243    1.435 1.007 0.314

Likelihood ratio test=0.94  on 1 df, p=0.3318
n= 8, number of events= 3 
   (38 observations deleted due to missingness)


============================

TCGA-COAD TRAF5 

[1] 7
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 14        3     3.86    0.1926     0.299
strata=LOW  32        9     8.14    0.0914     0.299

 Chisq= 0.3  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.3692    1.4466   0.6791 0.544 0.587

Likelihood ratio test=0.31  on 1 df, p=0.577
n= 46, number of events= 12 


============================

TCGA-COAD BIRC2 

[1] 8
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 16        4     3.69    0.0259    0.0413
strata=LOW  30        8     8.31    0.0115    0.0413

 Chisq= 0  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.1314    0.8768   0.6473 -0.203 0.839

Likelihood ratio test=0.04  on 1 df, p=0.8398
n= 46, number of events= 12 


============================

TCGA-COAD TRAF2 

[1] 9
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  9        1     2.31     0.740     0.968
strata=LOW  37       11     9.69     0.176     0.968

 Chisq= 1  on 1 degrees of freedom, p= 0.3 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.9971    2.7105   1.0558 0.944 0.345

Likelihood ratio test=1.16  on 1 df, p=0.282
n= 46, number of events= 12 


============================

TCGA-COAD BCL2 

[1] 10
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 24        5     5.28    0.0148    0.0296
strata=LOW  22        7     6.72    0.0117    0.0296

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.1059    1.1117   0.6159 0.172 0.864

Likelihood ratio test=0.03  on 1 df, p=0.8634
n= 46, number of events= 12 


============================

TCGA-COAD STAT4 

[1] 11
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 23        6     6.23   0.00850    0.0199
strata=LOW  23        6     5.77   0.00918    0.0199

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW 0.08592   1.08972  0.60968 0.141 0.888

Likelihood ratio test=0.02  on 1 df, p=0.8881
n= 46, number of events= 12 


============================

TCGA-COAD BIRC3 

[1] 12
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 24        6     5.68    0.0179    0.0373
strata=LOW  22        6     6.32    0.0161    0.0373

 Chisq= 0  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.1176    0.8891   0.6087 -0.193 0.847

Likelihood ratio test=0.04  on 1 df, p=0.8466
n= 46, number of events= 12 


============================

TCGA-COAD STAT1 

[1] 13
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 14        3     4.18     0.331     0.615
strata=LOW  32        9     7.82     0.177     0.615

 Chisq= 0.6  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z    p
strataLOW 0.6051    1.8314   0.7833 0.773 0.44

Likelihood ratio test=0.67  on 1 df, p=0.4119
n= 46, number of events= 12 


============================

TCGA-COAD STAT2 

[1] 14
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 11        2     1.88   0.00754   0.00935
strata=LOW  35       10    10.12   0.00140   0.00935

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.07666   0.92621  0.79318 -0.097 0.923

Likelihood ratio test=0.01  on 1 df, p=0.9236
n= 46, number of events= 12 


============================

TCGA-COAD TNFSF10 

[1] 15
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 29        6     7.12     0.175     0.514
strata=LOW  17        6     4.88     0.255     0.514

 Chisq= 0.5  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.4380    1.5496   0.6156 0.711 0.477

Likelihood ratio test=0.5  on 1 df, p=0.4814
n= 46, number of events= 12 


============================

TCGA-COAD TYK2 

[1] 16
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  8        2     1.77   0.02966    0.0362
strata=LOW  38       10    10.23   0.00513    0.0362

 Chisq= 0  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW -0.1504    0.8603   0.7919 -0.19 0.849

Likelihood ratio test=0.04  on 1 df, p=0.8516
n= 46, number of events= 12 


============================

TCGA-COAD PPIA 

[1] 17
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  9        2     1.75   0.03557    0.0434
strata=LOW  37       10    10.25   0.00607    0.0434

 Chisq= 0  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.1649    0.8479   0.7930 -0.208 0.835

Likelihood ratio test=0.04  on 1 df, p=0.8379
n= 46, number of events= 12 


============================

TCGA-COAD TNFRSF1A 

[1] 18
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 21        4     5.06     0.222     0.462
strata=LOW  25        8     6.94     0.162     0.462

 Chisq= 0.5  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z   p
strataLOW 0.4401    1.5529   0.6525 0.674 0.5

Likelihood ratio test=0.46  on 1 df, p=0.4958
n= 46, number of events= 12 


============================

TCGA-COAD CAPN2 

[1] 19
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 25        6     6.59    0.0528     0.135
strata=LOW  21        6     5.41    0.0644     0.135

 Chisq= 0.1  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.2247    1.2519   0.6127 0.367 0.714

Likelihood ratio test=0.13  on 1 df, p=0.715
n= 46, number of events= 12 


============================

TCGA-COAD FAS 

[1] 20
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 24        5     5.98     0.160     0.357
strata=LOW  22        7     6.02     0.159     0.357

 Chisq= 0.4  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.3629    1.4375   0.6109 0.594 0.552

Likelihood ratio test=0.36  on 1 df, p=0.5513
n= 46, number of events= 12 


============================

TCGA-COAD PGAM5 

[1] 21
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  6        1     1.06  0.003552   0.00404
strata=LOW  40       11    10.94  0.000345   0.00404

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW 0.06758   1.06991  1.06283 0.064 0.949

Likelihood ratio test=0  on 1 df, p=0.9489
n= 46, number of events= 12 


============================

TCGA-COAD MLKL 

[1] 22
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  9        2     1.13    0.6795     0.769
strata=LOW  37       10    10.87    0.0703     0.769

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z    p
strataLOW -0.6831    0.5051   0.7938 -0.86 0.39

Likelihood ratio test=0.64  on 1 df, p=0.4224
n= 46, number of events= 12 


============================

TCGA-COAD FADD 

[1] 23
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  7        1     1.63    0.2436     0.302
strata=LOW  39       11    10.37    0.0383     0.302

 Chisq= 0.3  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.5781    1.7826   1.0660 0.542 0.588

Likelihood ratio test=0.34  on 1 df, p=0.5598
n= 46, number of events= 12 


============================

TCGA-COAD TRPM7 

[1] 24
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 18        4     3.95  0.000754   0.00126
strata=LOW  28        8     8.05  0.000369   0.00126

 Chisq= 0  on 1 degrees of freedom, p= 1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.02297   0.97729  0.64838 -0.035 0.972

Likelihood ratio test=0  on 1 df, p=0.9718
n= 46, number of events= 12 


============================

TCGA-COAD FASLG 

[1] 25
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 26        7     8.35     0.219     0.775
strata=LOW  20        5     3.65     0.503     0.775

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.5374    1.7116   0.6173 0.871 0.384

Likelihood ratio test=0.74  on 1 df, p=0.3896
n= 46, number of events= 12 


============================

TCGA-COAD TNFRSF10B 

[1] 26
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 13        3     2.35    0.1804     0.231
strata=LOW  33        9     9.65    0.0439     0.231

 Chisq= 0.2  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.3257    0.7221   0.6802 -0.479 0.632

Likelihood ratio test=0.22  on 1 df, p=0.6407
n= 46, number of events= 12 


============================

TCGA-COAD VPS4A 

[1] 27
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.66    0.1633     0.225
strata=LOW  34       10     9.34    0.0465     0.225

 Chisq= 0.2  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.3742    1.4538   0.7938 0.471 0.637

Likelihood ratio test=0.24  on 1 df, p=0.6253
n= 46, number of events= 12 


============================

TCGA-COAD TNFRSF10A 

[1] 28
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  9        2     1.61    0.0941     0.113
strata=LOW  37       10    10.39    0.0146     0.113

 Chisq= 0.1  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.2651    0.7671   0.7924 -0.335 0.738

Likelihood ratio test=0.11  on 1 df, p=0.7446
n= 46, number of events= 12 


============================

TCGA-COAD GLUD1 

[1] 29
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 13        3     3.18   0.01069    0.0157
strata=LOW  33        9     8.82   0.00386    0.0157

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z   p
strataLOW 0.08662   1.09048  0.69088 0.125 0.9

Likelihood ratio test=0.02  on 1 df, p=0.8997
n= 46, number of events= 12 


============================

TCGA-COAD EIF2AK2 

[1] 30
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 14        2     3.41     0.585      0.86
strata=LOW  32       10     8.59     0.232      0.86

 Chisq= 0.9  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.7132    2.0406   0.7853 0.908 0.364

Likelihood ratio test=0.95  on 1 df, p=0.3303
n= 46, number of events= 12 


============================

TCGA-COAD CYLD 

[1] 31
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 18        4      3.9   0.00256   0.00423
strata=LOW  28        8      8.1   0.00123   0.00423

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.04215   0.95873  0.64791 -0.065 0.948

Likelihood ratio test=0  on 1 df, p=0.9482
n= 46, number of events= 12 


============================

TCGA-COAD SPATA2 

[1] 32
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 19        5     3.72     0.442     0.723
strata=LOW  27        7     8.28     0.198     0.723

 Chisq= 0.7  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW -0.5413    0.5820   0.6441 -0.84 0.401

Likelihood ratio test=0.7  on 1 df, p=0.4026
n= 46, number of events= 12 


============================

TCGA-COAD DNM1L 

[1] 33
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  8        2     1.67    0.0645    0.0777
strata=LOW  38       10    10.33    0.0104    0.0777

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.2202    0.8023   0.7920 -0.278 0.781

Likelihood ratio test=0.07  on 1 df, p=0.7856
n= 46, number of events= 12 


============================

TCGA-COAD CFLAR 

[1] 34
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 17        4     3.85   0.00622    0.0097
strata=LOW  29        8     8.15   0.00293    0.0097

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.06218   0.93971  0.63142 -0.098 0.922

Likelihood ratio test=0.01  on 1 df, p=0.9218
n= 46, number of events= 12 


============================

TCGA-COAD TICAM1 

[1] 35
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 18        2     4.07     1.056      1.85
strata=LOW  28       10     7.93     0.543      1.85

 Chisq= 1.8  on 1 degrees of freedom, p= 0.2 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z     p
strataLOW 1.037     2.821    0.797 1.301 0.193

Likelihood ratio test=2.01  on 1 df, p=0.156
n= 46, number of events= 12 


============================

TCGA-COAD HSP90AA1 

[1] 36
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 13        3     3.28   0.02335    0.0336
strata=LOW  33        9     8.72   0.00877    0.0336

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.1245    1.1326   0.6800 0.183 0.855

Likelihood ratio test=0.03  on 1 df, p=0.8534
n= 46, number of events= 12 


============================

TCGA-COAD IL33 

[1] 37
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 26        8     5.42      1.23      2.52
strata=LOW  20        4     6.58      1.01      2.52

 Chisq= 2.5  on 1 degrees of freedom, p= 0.1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -1.0601    0.3464   0.6953 -1.525 0.127

Likelihood ratio test=2.62  on 1 df, p=0.1053
n= 46, number of events= 12 


============================

TCGA-COAD IRF9 

[1] 38
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 16        4     3.86   0.00543   0.00844
strata=LOW  30        8     8.14   0.00257   0.00844

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.05788   0.94376  0.62996 -0.092 0.927

Likelihood ratio test=0.01  on 1 df, p=0.927
n= 46, number of events= 12 


============================

TCGA-COAD SHARPIN 

[1] 39
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  7        1     2.05     0.539     0.681
strata=LOW  39       11     9.95     0.111     0.681

 Chisq= 0.7  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.8459    2.3300   1.0555 0.801 0.423

Likelihood ratio test=0.8  on 1 df, p=0.3704
n= 46, number of events= 12 


============================

TCGA-COAD IFNAR1 

[1] 40
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 16        4     3.65    0.0345    0.0546
strata=LOW  30        8     8.35    0.0151    0.0546

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.1510    0.8598   0.6471 -0.233 0.815

Likelihood ratio test=0.05  on 1 df, p=0.8165
n= 46, number of events= 12 


============================

TCGA-COAD XIAP 

[1] 41
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 20        4     4.41    0.0380    0.0692
strata=LOW  26        8     7.59    0.0221    0.0692

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.1709    1.1864   0.6507 0.263 0.793

Likelihood ratio test=0.07  on 1 df, p=0.7918
n= 46, number of events= 12 


============================

TCGA-COAD VDAC3 

[1] 42
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  9        2      2.2    0.0179     0.023
strata=LOW  37       10      9.8    0.0040     0.023

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.1202    1.1278   0.7928 0.152 0.879

Likelihood ratio test=0.02  on 1 df, p=0.8781
n= 46, number of events= 12 


============================

TCGA-COAD CAMK2A 

[1] 43
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 32        8     7.01     0.141     0.392
strata=LOW  14        4     4.99     0.198     0.392

 Chisq= 0.4  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.4219    0.6558   0.6790 -0.621 0.534

Likelihood ratio test=0.41  on 1 df, p=0.5225
n= 46, number of events= 12 


============================

TCGA-COAD VDAC1 

[1] 44
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 10        3     1.86     0.697     0.863
strata=LOW  36        9    10.14     0.128     0.863

 Chisq= 0.9  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.6345    0.5302   0.6942 -0.914 0.361

Likelihood ratio test=0.76  on 1 df, p=0.3829
n= 46, number of events= 12 


============================

TCGA-COAD RIPK3 

[1] 45
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 21        5      4.9   0.00192   0.00357
strata=LOW  25        7      7.1   0.00133   0.00357

 Chisq= 0  on 1 degrees of freedom, p= 1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)     z     p
strataLOW -0.03668   0.96399  0.61408 -0.06 0.952

Likelihood ratio test=0  on 1 df, p=0.9524
n= 46, number of events= 12 


============================

TCGA-COAD CAPN1 

[1] 46
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  9        1     2.52     0.913      1.23
strata=LOW  37       11     9.48     0.242      1.23

 Chisq= 1.2  on 1 degrees of freedom, p= 0.3 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z     p
strataLOW 1.113     3.044    1.056 1.054 0.292

Likelihood ratio test=1.48  on 1 df, p=0.2232
n= 46, number of events= 12 


============================

TCGA-COAD USP21 

[1] 47
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  8        1     2.16     0.622     0.804
strata=LOW  38       11     9.84     0.137     0.804

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.9162    2.4997   1.0576 0.866 0.386

Likelihood ratio test=0.95  on 1 df, p=0.3291
n= 46, number of events= 12 


============================

TCGA-COAD AIFM1 

[1] 48
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 16        3     3.51    0.0729     0.115
strata=LOW  30        9     8.49    0.0301     0.115

 Chisq= 0.1  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.2363    1.2666   0.6978 0.339 0.735

Likelihood ratio test=0.12  on 1 df, p=0.7313
n= 46, number of events= 12 


============================

TCGA-COAD TRADD 

[1] 49
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH  6        1     1.73    0.3108     0.377
strata=LOW  40       11    10.27    0.0525     0.377

 Chisq= 0.4  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.6365    1.8899   1.0547 0.604 0.546

Likelihood ratio test=0.43  on 1 df, p=0.5114
n= 46, number of events= 12 


============================

TCGA-COAD OPTN 

[1] 50
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 17        4     3.65    0.0345    0.0546
strata=LOW  29        8     8.35    0.0151    0.0546

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.1510    0.8598   0.6471 -0.233 0.815

Likelihood ratio test=0.05  on 1 df, p=0.8165
n= 46, number of events= 12 


============================

TCGA-COAD PPID 

[1] 51
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.56    0.1228     0.167
strata=LOW  34       10     9.44    0.0333     0.167

 Chisq= 0.2  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.3228    1.3810   0.7939 0.407 0.684

Likelihood ratio test=0.18  on 1 df, p=0.675
n= 46, number of events= 12 


============================

TCGA-COAD RIPK1 

[1] 52
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 17        5     4.07     0.212     0.363
strata=LOW  29        7     7.93     0.109     0.363

 Chisq= 0.4  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.3811    0.6831   0.6367 -0.599 0.549

Likelihood ratio test=0.36  on 1 df, p=0.5506
n= 46, number of events= 12 


============================

TCGA-COAD TLR3 

[1] 53
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 33        7      8.4     0.234      1.01
strata=LOW  13        5      3.6     0.545      1.01

 Chisq= 1  on 1 degrees of freedom, p= 0.3 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.6268    1.8717   0.6339 0.989 0.323

Likelihood ratio test=0.91  on 1 df, p=0.3391
n= 46, number of events= 12 


============================

TCGA-COAD FAF1 

[1] 54
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 10        2     2.24   0.02644    0.0343
strata=LOW  36       10     9.76   0.00608    0.0343

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.1469    1.1582   0.7933 0.185 0.853

Likelihood ratio test=0.04  on 1 df, p=0.851
n= 46, number of events= 12 


============================

TCGA-COAD JAK1 

[1] 55
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 19        5     3.98     0.260     0.436
strata=LOW  27        7     8.02     0.129     0.436

 Chisq= 0.4  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.4163    0.6595   0.6351 -0.655 0.512

Likelihood ratio test=0.43  on 1 df, p=0.5136
n= 46, number of events= 12 


============================

Display the results only for genes where a significant difference in survival has been reported.

significant_genes
NULL
num_significant_genes <- length(significant_genes)

if (num_significant_genes > 0) {
  for (i in 1 : num_significant_genes) {
    project <- significant_projects[[i]]
    gene <- significant_genes[[i]]
    
    cat(project, gene, "\n\n")
    gene_df <- construct_gene_df(gene, project)
    
    survival <- compute_survival_diff(gene_df)
    cox <- compute_cox(gene_df)
    print(survival)
    cat("\n")
    print(cox)
    print(plot_survival(fit))
    
    cat("\n\n============================\n\n")
  } 
}

  1. De La Salle University, Manila, Philippines, ↩︎

  2. De La Salle University, Manila, Philippines, ↩︎

LS0tDQp0aXRsZTogIlN1cnZpdmFsIEFuYWx5c2lzIg0Kc3VidGl0bGU6ICJDb2xvcmVjdGFsIENhbmNlciB8IE5lY3JvcHRvc2lzIHwgVW5pcXVlIEdlbmVzIHBlciBSQ0QgVHlwZSB8IExvZyBGb2xkIENoYW5nZSINCmF1dGhvcjogDQogIC0gTWFyayBFZHdhcmQgTS4gR29uemFsZXNeW0RlIExhIFNhbGxlIFVuaXZlcnNpdHksIE1hbmlsYSwgUGhpbGlwcGluZXMsIGdvbnphbGVzLm1hcmtlZHdhcmRAZ21haWwuY29tXQ0KICAtIERyLiBBbmlzaCBNLlMuIFNocmVzdGhhXltEZSBMYSBTYWxsZSBVbml2ZXJzaXR5LCBNYW5pbGEsIFBoaWxpcHBpbmVzLCBhbmlzaC5zaHJlc3RoYUBkbHN1LmVkdS5waF0NCm91dHB1dDogaHRtbF9ub3RlYm9vaw0KLS0tDQoNCiMjIEkuIFByZWxpbWluYXJpZXMNCg0KIyMjIExvYWRpbmcgbGlicmFyaWVzD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AgIH0NCiAgICApDQogICAgDQogICAgaWYoaW5oZXJpdHMoZXJyb3IsICJlcnJvciIpKSBuZXh0DQoNCiAgICBpZiAobnJvdyhnZW5lX2RmKSA+IDApIHsNCiAgICAgIGZpdCA8LSBjb21wdXRlX3N1cml2YWxfZml0KGdlbmVfZGYpDQogICAgICB0cnlDYXRjaCAoDQogICAgICAgIHsNCiAgICAgICAgICBzdXJ2aXZhbCA8LSBjb21wdXRlX3N1cnZpdmFsX2RpZmYoZ2VuZV9kZikNCiAgICAgICAgICBjb3ggPC0gY29tcHV0ZV9jb3goZ2VuZV9kZikNCiAgICAgICAgICBwcmludChjdHIpDQogICAgICAgICAgY3RyIDwtIGN0ciArIDENCiAgICAgICAgICBwcmludChzdXJ2aXZhbCkNCiAgICAgICAgICBjYXQoIlxuIikNCiAgICAgICAgICBwcmludChjb3gpDQogICAgICAgICAgcHJpbnQocGxvdF9zdXJ2aXZhbChmaXQpKQ0KICAgICAgICAgIGlmIChwY2hpc3Eoc3Vydml2YWwkY2hpc3EsIGxlbmd0aChzdXJ2aXZhbCRuKS0xLCBsb3dlci50YWlsID0gRkFMU0UpIDwgMC4wNSkgew0KICAgICAgICAgICAgc2lnbmlmaWNhbnRfcHJvamVjdHMgPC0gYyhzaWduaWZpY2FudF9wcm9qZWN0cywgcHJvamVjdCkNCiAgICAgICAgICAgIHNpZ25pZmljYW50X2dlbmVzIDwtIGMoc2lnbmlmaWNhbnRfZ2VuZXMsIGdlbmUpDQogICAgICAgICAgfQ0KICAgICAgICB9LA0KICAgICAgICBlcnJvciA9IGZ1bmN0aW9uKGUpIHsNCiAgICAgICAgfQ0KICAgICAgKQ0KICAgICAgDQogICAgfQ0KICAgIA0KICAgIGNhdCgiXG5cbj09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuIikNCiAgfQ0KfQ0KYGBgDQoNCkRpc3BsYXkgdGhlIHJlc3VsdHMgb25seSBmb3IgZ2VuZXMgd2hlcmUgYSBzaWduaWZpY2FudCBkaW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